﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using WorkRecorder.Business;
using System.Collections.ObjectModel;
using System.Windows.Controls;

namespace WorkRecorder.Helpers.Converters
{
    public class TimeSpanConverter : IValueConverter
    {
 

        public TimeSpanConverter() { }

 
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            //StringFormat={}{0:hh:mm:ss}
            var ticks = (long)value;
            TimeSpan rs = new TimeSpan(ticks);
            string convertedTime = string.Format("{0:00}:{1:00}:{2:00}", rs.Hours, rs.Minutes, rs.Seconds);
            return convertedTime;  
 
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
